<?php 
	session_start(); 
	if (!$_SESSION["id_no"])
    {
        Header("Location: index.php");
    }
	else{
		if ($_SESSION['account_type']=='root'){
			$header="secured/header_login";
			$admin="yes";
		}
		elseif($_SESSION['account_type']=='Admin'){ 
			$header="secured/header_login";
			$admin="yes";
		}else{
			$header="header";
			$admin="no";
		}
	}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ralimo System Panel</title>
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />
<link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css" type="text/css" media="screen" title="default" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="css/pro_dropline_ie.css" />
<![endif]-->
<!--  jquery core -->
<script src="js/jquery/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
<!--  date picker script -->
<link rel="stylesheet" href="css/datePicker.css" type="text/css" />
<script type="text/javascript" src="js/jquery/infowindow.js"></script>
</head>
<body> 
<?php 
	include"template/$header.php"; 
	
	$id = $_GET['id'];
	require "query/db_connection.php";
	$sql = "SELECT 
			affiliate.affiliateid,
			affiliate.companyname
			FROM
			affiliate
			WHERE
			affiliateid='$id'
			";
	$res = mysql_query($sql);				
	$count = mysql_num_rows($res);
	
	while($row = mysql_fetch_array($res)){
		$id	= $row['affiliateid'];
		$companyname = $row['companyname'];
	}
	
	$acc_num = 0;
	$class_alternate = '';
	
	$sql1 = "SELECT
			a.destination,
			a.destination,
			v.vehiclemodel,
			v.vehicletype,
			v.capacity,
			v.image,
			a.rate
			FROM airportrate AS a, vehicles AS v
			WHERE a.affiliateid = '$id' AND v.affiliateid = '$id'
			AND a.vehiclemodel = v.vehiclemodel
			";
    $res = mysql_query($sql1);
	
?>
  <div class='clear'></div>
<!-- start content-outer ........................................................................................................................START -->
	<div id='content-outer'>
	<!-- start content -->
	<div id='content'>

	<!--  start page-heading -->
	<div id='page-heading'>
		<h1><?php echo $companyname;?> -Airport Rates</h1>
	</div>
	<!-- end page-heading -->
	
	<div id="back_affiliate"  style="margin-left:935px; ">
		<a href="<?php echo"view_affiliate_hr.php?id=".$id;?>"><img src="images/forms/hourly_rate.png" /></a>
		<a href="<?php echo"view_affiliate_ow.php?id=".$id;?>"><img src="images/forms/oneway_rate.png"/></a>
		<a href="panel.php?page=affiliate"><img src="images/forms/back.png" /></a>
	</div>

	<table border='0' width='100%' cellpadding='0' cellspacing='0' id='content-table'>
	<tr>
		<th rowspan='3' class='sized'><img src='images/shared/side_shadowleft.jpg' width='20' height='300' alt='' /></th>
		<th class='topleft'></th>
		<td id='tbl-border-top'>&nbsp;</td>
		<th class='topright'></th>
		<th rowspan='3' class='sized'><img src='images/shared/side_shadowright.jpg' width='20' height='300' alt='' /></th>
	</tr>
	<tr>
		<td id='tbl-border-left'></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id='content-table-inner'>
						<!--  start step-holder -->
			
		<!--  end step-holder -->
		
			<!--  start table-content  -->
			<div id='table-content'>
				<form id="mainform" action="">
					<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
						<tr>
							<th class="table-header-check" id="head">No.#</th>
							<th class="table-header-repeat line-left minwidth-1" width="200px"><a href="">Vehicle Model</a>	</th>
							<th class="table-header-repeat line-left minwidth-1" width="285px"><a href="">Vehicle Type</a></th>
							<th class="table-header-repeat line-left" width="220px"><a href="">Capacity</a></th>
							<th class="table-header-repeat line-left" width="220px"><a href="">Destination</a></th>
							<th class="table-header-repeat line-left" width="220px"><a href="">Rate</a></th>
						</tr>
						<tr>
						<?php
							while($row = mysql_fetch_array($res)){
								$acc_num=$acc_num+1;
								echo"<tr class='". $class_alternate ."'>
												<td>".$acc_num."</td>
												<td><b>" .$row['vehiclemodel']. "</b></td>
												<td>" .$row['vehicletype']. "</td>
												<td>" .$row['capacity']. "</td>
												<td>" .$row['destination']. "</td>
												<td>" .$row['rate']. "</td>
											</tr> ";
								if($class_alternate==""){ 
									$class_alternate="alternate-row";
								}
								else{
									$class_alternate="";
								}
						}
						?>
						</tr>											
					</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			<!--  end table-content  -->
	
			<div class='clear'></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id='tbl-border-right'></td>
	</tr>
	<tr>
		<th class='sized bottomleft'></th>
		<td id='tbl-border-bottom'>&nbsp;</td>
		<th class='sized bottomright'></th>
	</tr>
	</table>
	<div class='clear'>&nbsp;</div>

	</div>
	<!--  end content -->
	<div class='clear'>&nbsp;</div>
	</div>
	<!--  end content-outer........................................................END -->";
				
<!--  start nav-outer-repeat................................................... END -->

  <div class="clear"></div>
 
<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
<!-- start content -->
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer........................................................END -->

<div class="clear">&nbsp;</div>
    
<?php include"template/footer.php"; ?>
 
</body>
</html>


